package com.ruoyi.business.domain;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 进货单对象 purchase_receipt
 * 
 * @author ruoyi
 * @date 2025-03-20
 */
public class PurchaseReceipt extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 自增长主键 */
    private Long id;

    /** 进货单编号 */
    @Excel(name = "进货单编号")
    private String receiptCode;

    /** 供应商ID */
    @Excel(name = "供应商ID")
    private Long supplierId;

    /** 业务日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "业务日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date businessDate;

    /** 应付金额 */
    @Excel(name = "应付金额")
    private BigDecimal totalAmount;

    /** 订金抵扣 */
    @Excel(name = "订金抵扣")
    private BigDecimal depositDeduction;

    /** 实付金额 */
    @Excel(name = "实付金额")
    private BigDecimal actualPayment;

    /** 待付金额 */
    @Excel(name = "待付金额")
    private BigDecimal pendingPayment;

    /** 支付方式（微信、支付宝、现金） */
    @Excel(name = "支付方式", readConverterExp = "微=信、支付宝、现金")
    private String paymentMethod;

    /** 支付附件 */
    @Excel(name = "支付附件")
    private String paymentAttachment;

    /** 单据状态（pending, approved, completed, cancelled） */
    @Excel(name = "单据状态", readConverterExp = "p=ending,,a=pproved,,c=ompleted,,c=ancelled")
    private String status;

    @JsonProperty(value = "purchaseDetailItemList")
    private List<PurchaseReceiptItem> purchaseReceiptItemList;


    /**
     * 运费
     */
    private BigDecimal freight;

    /**
     * 折扣类型
     */
    private String discountType;

    /**
     * 折后金额
     */
    private BigDecimal discountedAmount;

    /**
     *折扣/优惠金额
     */
    private BigDecimal discount;


    /**
     * 业务员
     */
    private String salesman;

    private String type;

    private BigDecimal alipayAmount;
    private BigDecimal bankAmount;
    private BigDecimal cashAmount;
    private BigDecimal wechatAmount;

    private long userId;

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public BigDecimal getAlipayAmount() {
        return alipayAmount;
    }

    public void setAlipayAmount(BigDecimal alipayAmount) {
        this.alipayAmount = alipayAmount;
    }

    public BigDecimal getBankAmount() {
        return bankAmount;
    }

    public void setBankAmount(BigDecimal bankAmount) {
        this.bankAmount = bankAmount;
    }

    public BigDecimal getCashAmount() {
        return cashAmount;
    }

    public void setCashAmount(BigDecimal cashAmount) {
        this.cashAmount = cashAmount;
    }

    public BigDecimal getWechatAmount() {
        return wechatAmount;
    }

    public void setWechatAmount(BigDecimal wechatAmount) {
        this.wechatAmount = wechatAmount;
    }

    public BigDecimal getFreight() {
        return freight;
    }

    public void setFreight(BigDecimal freight) {
        this.freight = freight;
    }

    public String getDiscountType() {
        return discountType;
    }

    public void setDiscountType(String discountType) {
        this.discountType = discountType;
    }

    public BigDecimal getDiscountedAmount() {
        return discountedAmount;
    }

    public void setDiscountedAmount(BigDecimal discountedAmount) {
        this.discountedAmount = discountedAmount;
    }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    public String getSalesman() {
        return salesman;
    }

    public void setSalesman(String salesman) {
        this.salesman = salesman;
    }

    public List<PurchaseReceiptItem> getPurchaseReceiptItemList() {
        return purchaseReceiptItemList;
    }

    public void setPurchaseReceiptItemList(List<PurchaseReceiptItem> purchaseReceiptItemList) {
        this.purchaseReceiptItemList = purchaseReceiptItemList;
    }

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setReceiptCode(String receiptCode) 
    {
        this.receiptCode = receiptCode;
    }

    public String getReceiptCode() 
    {
        return receiptCode;
    }

    public void setSupplierId(Long supplierId) 
    {
        this.supplierId = supplierId;
    }

    public Long getSupplierId() 
    {
        return supplierId;
    }

    public void setBusinessDate(Date businessDate) 
    {
        this.businessDate = businessDate;
    }

    public Date getBusinessDate() 
    {
        return businessDate;
    }

    public void setTotalAmount(BigDecimal totalAmount) 
    {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getTotalAmount() 
    {
        return totalAmount;
    }

    public void setDepositDeduction(BigDecimal depositDeduction) 
    {
        this.depositDeduction = depositDeduction;
    }

    public BigDecimal getDepositDeduction() 
    {
        return depositDeduction;
    }

    public void setActualPayment(BigDecimal actualPayment) 
    {
        this.actualPayment = actualPayment;
    }

    public BigDecimal getActualPayment() 
    {
        return actualPayment;
    }

    public void setPendingPayment(BigDecimal pendingPayment) 
    {
        this.pendingPayment = pendingPayment;
    }

    public BigDecimal getPendingPayment() 
    {
        return pendingPayment;
    }

    public void setPaymentMethod(String paymentMethod) 
    {
        this.paymentMethod = paymentMethod;
    }

    public String getPaymentMethod() 
    {
        return paymentMethod;
    }

    public void setPaymentAttachment(String paymentAttachment) 
    {
        this.paymentAttachment = paymentAttachment;
    }

    public String getPaymentAttachment() 
    {
        return paymentAttachment;
    }

    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }

    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("receiptCode", getReceiptCode())
            .append("supplierId", getSupplierId())
            .append("businessDate", getBusinessDate())
            .append("totalAmount", getTotalAmount())
            .append("depositDeduction", getDepositDeduction())
            .append("actualPayment", getActualPayment())
            .append("pendingPayment", getPendingPayment())
            .append("paymentMethod", getPaymentMethod())
            .append("paymentAttachment", getPaymentAttachment())
            .append("status", getStatus())
            .append("remark", getRemark())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
